package com.bst.etl.factory.dbtype;

public class MySQLTypeMapping implements ITypeMappingStrategy {
    @Override
    public String mapType(int columnType, int precision, int scale) {
        switch (columnType) {
            case java.sql.Types.INTEGER: return "INT";
            case java.sql.Types.VARCHAR: return "VARCHAR(" + precision + ")";
            case java.sql.Types.DECIMAL: return "DECIMAL(" + precision + "," + scale + ")";
            default: return "TEXT";
        }
    }

    @Override
    public String primaryKey() {
        return "ID BIGINT AUTO_INCREMENT PRIMARY KEY,";
    }
}

